package org.lboot.jpa.service;

import org.lboot.core.domain.PageResultDTO;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import java.io.Serializable;
import java.util.List;

/**
 * @author kindear
 */
public interface SpecService <Entity extends Serializable,KeyType>{
    /**
     * 条件分页查询
     * @param pageable
     * @param spec
     * @return
     */
    PageResultDTO<Entity> getAll(Pageable pageable, Specification<Entity> spec);

    /**
     * 谓词条件查询全部
     * @param spec
     * @return
     */
    List<Entity> getAll(Specification<Entity> spec);
}
